<!doctype html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">

<head>
    <title>病房管理系统-登录</title>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="icon" type="image/png" th:href="@{/assets/img/icons/favicon.ico}"/>
    <link rel="stylesheet" type="text/css" th:href="@{/assets/css/bootstrap.css}">
    <link rel="stylesheet" type="text/css" th:href="@{/assets/fonts/font-awesome-4.7.0/css/font-awesome.min.css}">
    <link rel="stylesheet" type="text/css" th:href="@{/assets/fonts/Linearicons-Free-v1.0.0/icon-font.min.css}">
    <link rel="stylesheet" type="text/css" th:href="@{/assets/vendor/animate/animate.css}">
    <link rel="stylesheet" type="text/css" th:href="@{/assets/vendor/css-hamburgers/hamburgers.min.css}">
    <link rel="stylesheet" type="text/css" th:href="@{/assets/vendor/animsition/css/animsition.min.css}">
    <link rel="stylesheet" type="text/css" th:href="@{/assets/vendor/select2/select2.min.css}">
    <link rel="stylesheet" type="text/css" th:href="@{/assets/vendor/daterangepicker/daterangepicker.css}">
    <link rel="stylesheet" type="text/css" th:href="@{/assets/css/util.css}">
    <link rel="stylesheet" type="text/css" th:href="@{/assets/css/main.css}">
    <link th:href="@{/assets/css/now-ui-dashboard.css?v=1.0.1}" rel="stylesheet" />
</head>

<body>

    <div class="limiter">
        <div class="container-login100" style="background:url('../static/assets/img/background.jpg');">
            <div class="wrap-login100 p-t-30 p-b-50">
                <span class="login100-form-title p-b-41" th:text="${msg==null?'病房管理系统':msg}">
					病房管理系统
				</span>
                <form name="login_form" class="login100-form validate-form p-b-33 p-t-5">

                    <div class="wrap-input100 validate-input" data-validate="请输入用户名！">
                        <input id="username" class="input100" type="text" name="username" placeholder="用户名" required>
                        <span class="focus-input100" data-placeholder="&#xe82a;"></span>
                    </div>

                    <div class="wrap-input100 validate-input" data-validate="请输入密码！">
                        <input id="password" class="input100" type="password" name="password" placeholder="密码" required>
                        <span class="focus-input100" data-placeholder="&#xe80f;"></span>
                    </div>

                    <div class="container-login100-form-btn m-t-32">
                        <button type="button" onclick="login()" class="login100-form-btn">
							登录
						</button>
                    </div>

                </form>

            </div>
        </div>
    </div>


    <div id="dropDownSelect1"></div>

    <script th:src="@{/assets/js/jquery-3.5.1.js}"></script>
    <script th:src="@{/assets/vendor/animsition/js/animsition.min.js}"></script>
    <script th:src="@{/assets/js/core/popper.js}"></script>
    <script th:src="@{/assets/js/core/bootstrap.js}"></script>
    <script th:src="@{/assets/vendor/select2/select2.min.js}"></script>
    <script th:src="@{/assets/vendor/daterangepicker/moment.min.js}"></script>
    <script th:src="@{/assets/vendor/daterangepicker/daterangepicker.js}"></script>
    <script th:src="@{/assets/vendor/countdowntime/countdowntime.js}"></script>
    <script th:src="@{/assets/js/main.js}"></script>
    <script th:src="@{/assets/js/plugins/bootstrap-notify.js}"></script>
    <script th:src="@{/assets/demo/demo.js}"></script>


</body>
<script>
    function login(){
        var username = $("#username").val();
        var password = $("#password").val();
        $.ajax({
            url:'/login',
            data:{
                'username':username,
                'password':password
            },
            method:'post',
            dataType:'text',
            success:function(result){
                if(result==='登录成功!'){
                    demo.showNotification('success',result);
                    setTimeout(function (){
                        window.location = '/toDashBoard'
                    },1000)
                    return;
                }

                demo.showNotification('danger',result);
            }
        })
    }
</script>
</html>